﻿using LaserAutoTest.Application;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace LaserAutoTest.UI.Extensions
{
    public class SubtractConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            double doubleValue;
            double doubleParameter;

            double.TryParse(value.ToString(), out doubleValue);
            double.TryParse(parameter.ToString(), out doubleParameter);

            return doubleValue - doubleParameter;

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return GlobalValues.MainWindowSize.Width;
        }
    }
}
